<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="../../WEB-INF/c.tld" prefix="c" %>
<jsp:directive.page contentType="text/html;charset=UTF-8" />

<div class="main">
	<div class="container">
		<h2><bean:message key="paiement.list.mainTitle" /></h2>
		<c:if test="${success != null }">
			<div class="alert alert-success">
				<bean:message key="${success }" />
    		</div>
		</c:if>
		<c:if test="${error != null}">
			<div class="alert alert-error">
				<bean:message key="${error }" />
    		</div>
		</c:if>
		<html:form action="/mode-paiement-post" method="post">
			<table class="table table-striped">
				<thead>
					<tr>
						<th><bean:message key="paiement.libelle" /></th>
						<th class="center"><bean:message key="paiement.accessNormalClient" /></th>
						<th class="center"><bean:message key="paiement.accessSuperClient" /></th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${listMode }" var="mode">
						<tr>
							<td>${mode.libelle }</td>
							<c:if test="${mode.accesClientClassique == true}">
								<c:set var="accesNormal" value="checked" />
							</c:if>
							<c:if test="${mode.accesClientClassique == false}">
								<c:set var="accesNormal" value="" />
							</c:if>
							<c:if test="${mode.accesSuperClient == true}">
								<c:set var="accesSuper" value="checked" />
							</c:if>
							<c:if test="${mode.accesSuperClient == false}">
								<c:set var="accesSuper" value="" />
							</c:if>
							<td class="center">
							<input type="checkbox" name="accesClientNormal" value="${mode.idModePaiement }" size="16" maxlength="16" ${accesNormal } /></td>
							<td class="center"><input type="checkbox" name="accesSuperClient" value="${mode.idModePaiement }" size="16" maxlength="16" ${accesSuper } /></td>
						</tr>
					</c:forEach>						
				</tbody>
				
	    	</table>
    	
    	<div class="linkCenter"><button class="btn btn-primary" type="submit"><bean:message key="general.valider" /></button></div>
    	</html:form>
	</div>
</div>